<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>展示页面</title>
</head>
<body>

<div>
    <form action="${pageContext.request.contextPath}/book/getBookByName" method="post">
        <input type="text" name="bookName" placeholder="请输入要查询的书籍名称">
        <button type="submit">查询</button>
    </form>
</div>


<table>
    <thead>
        <tr>
            <th>书籍id</th>
            <th>书籍名称</th>
            <th>书籍数量</th>
            <th>书籍详情</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <c:forEach var="book" items="${list}">
            <tr>
                <td>${book.bookID}</td>
                <td>《${book.bookName}》</td>
                <td>${book.bookNum}</td>
                <td>${book.detail}</td>
                <td>
                    <a href="${pageContext.request.contextPath}/book/toModBook?id=${book.bookID}">修改</a>
                    &emsp; | &emsp;
                    <a href="${pageContext.request.contextPath}/book/delBook?id=${book.bookID}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </tbody>
</table>

<div>
    <a href="${pageContext.request.contextPath}/book/toAddBook">添加书籍</a>
</div>

</body>
</html>
